//
//  GQHShipperAuthorizationInfoController.m
//  Xanthium
//
//  Created by GuanQinghao on 31/03/2018.
//  Copyright © 2018 GuanQinghao. All rights reserved.
//

#pragma mark Macro
#import "GQHHeader.h"

#pragma mark Model

#pragma mark Object

#pragma mark View
#import "GQHShipperAuthorizationInfoView.h"

#pragma mark Controller
#import "GQHShipperAuthorizationInfoController.h"

#pragma mark CocoaPods

#pragma mark ----------Header End----------

@interface GQHShipperAuthorizationInfoController () {
    
#pragma mark Data
    NSMutableArray *contentArray;
#pragma mark View
    /// 自定义根视图
    GQHShipperAuthorizationInfoView *rootView;
}

@end


@implementation GQHShipperAuthorizationInfoController

#pragma mark --Lifecycle
- (void)loadView {
    DLog();
    
    rootView = [[GQHShipperAuthorizationInfoView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.view = rootView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    DLog();
    
    [self loadLocalData];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    DLog();
    
    self.qh_titleLabel.text = @"无车承运人认证信息";
    [self.qh_rightButton setHidden:YES];
    self.automaticallyAdjustsScrollViewInsets = NO;
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    DLog();
    
}

#pragma mark --Delegate

#pragma mark --TargetMethod

#pragma mark --PrivateMethod
- (void)loadLocalData {
    
    //    titleArray = @[@"公司名称",@"公司地址",@"联系人",@"联系电话",@"身份证号码",@"营业执照号码",@"企业介入码",@"企业接入AppKey",@"社会信用代码",@"本人正面照",@"身份证正面",@"身份证反面",@"门面照片",@"营业执照照片",@"道路运输许可证",@"企业纳税凭证"];
    
    contentArray = [NSMutableArray arrayWithCapacity:20];
    
    // 公司名称
    NSString *companyName = [_qh_authenticatedInfo objectForKey:@"companyName"];
    [contentArray qh_safetySetObject:companyName atIndex:0];
    
    // 公司地址
    NSString *companyAdd = [_qh_authenticatedInfo objectForKey:@"companyAdd"];
    [contentArray qh_safetySetObject:companyAdd atIndex:1];
    
    // 联系人
    NSString *empName = [_qh_authenticatedInfo objectForKey:@"empName"];
    [contentArray qh_safetySetObject:empName atIndex:2];
    
    // 联系电话
    NSString *phoneNum = [_qh_authenticatedInfo objectForKey:@"phoneNum"];
    [contentArray qh_safetySetObject:phoneNum atIndex:3];
    
    // 身份证号码
    NSString *idNumber = [_qh_authenticatedInfo objectForKey:@"idNumber"];
    [contentArray qh_safetySetObject:idNumber atIndex:4];
    
    // 营业执照号码
    NSString *businessLicenseNumber = [_qh_authenticatedInfo objectForKey:@"businessLicenseNumber"];
    [contentArray qh_safetySetObject:businessLicenseNumber atIndex:5];
    
    // 企业介入码
    NSString *enterpriseAccessCode = [_qh_authenticatedInfo objectForKey:@"enterpriseAccessCode"];
    [contentArray qh_safetySetObject:enterpriseAccessCode atIndex:6];
    
    // 企业接入AppKey
    NSString *enterpriseAccessAppkey = [_qh_authenticatedInfo objectForKey:@"enterpriseAccessAppkey"];
    [contentArray qh_safetySetObject:enterpriseAccessAppkey atIndex:7];
    
    // 社会信用代码
    NSString *socialCreditCode = [_qh_authenticatedInfo objectForKey:@"socialCreditCode"];
    [contentArray qh_safetySetObject:socialCreditCode atIndex:8];
    
    // 本人正面照
    NSString *selfPortrait = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"selfPortrait"]];
    [contentArray qh_safetySetObject:selfPortrait atIndex:9];
    
    // 身份证正面
    NSString *positiveIdentityCard = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"positiveIdentityCard"]];
    [contentArray qh_safetySetObject:positiveIdentityCard atIndex:10];
    
    // 身份证反面
    NSString *backIdentityCard = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"backIdentityCard"]];
    [contentArray qh_safetySetObject:backIdentityCard atIndex:11];
    
    // 门面照片
    NSString *storePhotos = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"storePhotos"]];
    [contentArray qh_safetySetObject:storePhotos atIndex:12];
    
    // 营业执照照片
    NSString *businessLicensePjoto = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"businessLicensePjoto"]];
    [contentArray qh_safetySetObject:businessLicensePjoto atIndex:13];
    
    // 道路运输许可证
    NSString *transportRoadPermit = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"transportRoadPermit"]];
    [contentArray qh_safetySetObject:transportRoadPermit atIndex:14];
    
    // 企业纳税凭证
    NSString *enterpriseTaxCertificate = [NSString stringWithFormat:@"%@/%@",[NSString qh_imageURLString],[_qh_authenticatedInfo objectForKey:@"enterpriseTaxCertificate"]];
    [contentArray qh_safetySetObject:enterpriseTaxCertificate atIndex:15];
    
    rootView.qh_contentArray = contentArray;
    [rootView.qh_tableView reloadData];
}

#pragma mark --Setter

#pragma mark --Getter

#pragma mark --View

@end
